package com.magic.springboot.service.impl;

import com.magic.springboot.mapper.BookMapper;
import com.magic.springboot.pojo.Books;
import com.magic.springboot.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookMapper bookMapper;

    @Override
    public int addBook(Books book) {
        return bookMapper.addBook(book);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    @Override
    public List<Books> queryLikeBook(String bookName, String bookCategory) {
        return bookMapper.queryLikeBook(bookName, bookCategory);
    }
    // @Override
    // public List<Books> queryLikeBook(String bookName, String bookCategory) {
    //     return bookMapper.queryLikeBook(bookName,bookCategory);
    // }
}
